package com.wkq.util.transformer

import android.view.View
import androidx.viewpager2.widget.ViewPager2

/**
 *
 *@Author: wkq
 *
 *@Time: 2025/7/28 17:57
 *
 *@Desc: 淡入淡出切换（Fade）
 */
class FadePageTransformer : ViewPager2.PageTransformer {
    override fun transformPage(view: View, position: Float) {
        view.apply {
            alpha = 1 - Math.abs(position)
            translationX = width * -position
            translationZ = -Math.abs(position)
        }
    }
}
